import React, { Component } from "react";
const msgdata = [
  { id: "01", msg: "吃好喝好才是最重要的！" },
  { id: "02", msg: "年轻人就要醒着拼！" },
  { id: "03", msg: "能活着就行！" },
  { id: "04", msg: "大家说的都对！" },
];
export class Detail extends Component {
 
  render() {
    // const { id, name, age } = this.props.location.state || {};
    const { id, name, age } = this.props.match.params || {};
    const msg = msgdata.find((value) => value.id === id) || {};
    return (
      <>
        <p>
          <b>姓名：</b>
          <span>{name}</span>
        </p>
        <p>
          <b>年龄：</b>
          <span>{age}</span>
        </p>
        <p>
          <b>个性签名：</b>
          <span>{msg.msg}</span>
        </p>

      </>
    );
  }
}
